﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Aker.DevTeam;
using DevExpress.XtraEditors;
using DevExpress.XtraGrid.Views.Base;
using DevExpress.XtraGrid.Views.Grid;
using Extensions;
using DevExpress.XtraReports.UI;

namespace Aker.Tanimlar
{
    public partial class Depo : XForm
    {
        public Depo()
        {
            InitializeComponent();
        }

        private void Depo_Load(object sender, EventArgs e)
        { 
            Data.TAM.DepoTableAdapter.Fill(Data.DB.Depo);
            gv.Init(Data.DB.Depo);
            gv.MakeEditable("DepoId");

            gv.OptionsView.NewItemRowPosition = NewItemRowPosition.Bottom;
            gv.OptionsView.ShowViewCaption = false;

            gv.CellValueChanged += gv_CellValueChanged;
        }

        void gv_CellValueChanged(object sender, CellValueChangedEventArgs e)
        {
            gv.EndEditing();
            Data.TAM.DepoTableAdapter.Update(Data.DB.Depo);
        }

    }
}
